#ifndef __XML_WIDGET_LUAENGINE_H__
#define __XML_WIDGET_LUAENGINE_H__

#include "xmlWidget.h"
using namespace xmlWidgetLib;

#include <lua.hpp>

namespace xmlWidgetLib
{
	class xmlWidgetLuaEngine
	{
	public:
		static xmlWidgetLuaEngine *getGlobalInstance( void );
	
		void doLuaAction( const char *script ,xmlWidget* pWidget );
		xmlWidget* searchWidget(const string &key);

		~xmlWidgetLuaEngine();
	private:
		xmlWidgetLuaEngine();
		
		void insertWidget(xmlWidget* pWidget);

		lua_State		*m_L;
		xmlWidgetMap	m_ActionWidget;
		xmlWidget		*m_RootWidget;		
	};
};

#endif // __XML_WIDGET_LUAENGINE_H__
